﻿
<!DOCTYPE html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>登录</title>
<!-- jQuery -->
<script src="../js/jquery.min.js"></script>
<!-- jQuery Easing -->
<script src="../js/jquery.easing.1.3.js"></script>

</head>
<body>
	<script>
    	
		    	function login(){
		    		var name=$("#name").val();
					var pass=$("#pws").val();
					
		    		$.ajax({
		    			url:"${pageContext.request.contextPath}/system/user/login",
		    			type:"post",
		    			data:{
		    					"username":name,
		    					"password":pass
		    					},
		    			dataType:"json",
		    			success:function(data){
		    				window.location.href="${pageContext.request.contextPath}/system/news/getindex";			
		    			},
		    			error:function(){
		    				alert("账号或密码错误！！！");
		    			}
		    		});
		    		
		    	}
    
    	
    </script>



	<h1>LOGIN</h1>
	用户名:
	<input type="text" name="username" id="name">
	<br /> 密&nbsp;&nbsp;&nbsp;&nbsp;码:
	<input type="text" name="password" id="pws">
	<br />
	<div class="a">
		<input type="button" value="登录" onclick="login()">
	</div>

</body>
</html>

